# -*- coding = utf-8 -*-
#@Time: 2020/10/23 10:22
#@Author: 卜白
#@File: __init__.py.py
#@Software: PyCharm

from flask import Flask
import settings
from exts import db,bootstrap
from apps.house.view import house_bp
from apps.user.view import user_bp

def create_app():
    app = Flask(__name__,template_folder='../templates',static_folder='../static')
    # 加载配置文件
    app.config.from_object(settings.DevelopmentConfig)  # 开发模式

    # 初始化配置db
    db.init_app(app=app)
    # 初始化bootstrap
    bootstrap.init_app(app=app)
    # 注册蓝图
    app.register_blueprint(house_bp)
    app.register_blueprint(user_bp)

    print(app.url_map)

    return app
